<script type="text/javascript">
$(function () {
	$('#search button[type=submit]').on('click', function(event) {
		action = $('form#search').attr('action');
		data = $('form#search').serialize();

		$.post(action, data, function (data) {
			$('#search-results').html(data);
		});

		event.preventDefault();
	});
});
</script>
{% if id %}
	<div class="tab-pane" id="search">
		<form id='search' class="form-inline" role="form" action="{% url "search_behavior" id %}">
			{% csrf_token %}
			<div class="form-group">
				<label class="sr-only" for="form_search">Search term</label>
				<input type="text" class="form-control" id="form_search" name="search" size=50 placeholder="Search term" />
			</div>
			<button type="submit" class="btn btn-secondary">Search</button>
		</form>

		<div id="search-results">
		</div>
	</div>
{% endif %}
